package models.cms;

import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Lob;

import play.data.validation.Constraints.Required;
import play.db.ebean.Model;


@Entity
public class CMSImage extends Model {


    @Required
	@Id
	public String name;

    @Required
	public String title;

    @Required
    public String contentType;



    // see http://stackoverflow.com/questions/10808069/how-to-use-blob-with-ebean-play-2
    @Required
    @Lob
	public byte[] data;

    public static Finder<String,CMSImage> find = new Finder(
            String.class, CMSImage.class
    );

}
